/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: XMQ
 * Date: 2022-05-09
 * Time: 19:12
 */
public class Dog {
    public String name ;
    public int age ;
    public String color;

    Dog(){
//        this.name = "小黑";
//        this.age = 2;
//        this.color = "白色";
        this("小黑",2,"白色");
        System.out.println("不带参数的构造方法");
    }
    Dog(String name, int age, String color){
        this.name = name;
        this.age = age;
        this.color = color;
        System.out.println("带参数的构造方法");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public void wag(){
        System.out.println("摇尾巴~");
    }
    public void bark(){
        System.out.println("汪汪~");
    }
    public void show(){
        System.out.println(name+" "+age+" "+color);
    }

    public static void main(String[] args) {
        Dog dog1 = new Dog();
        dog1.wag();
        dog1.bark();
        dog1.show();

        System.out.println("======================");
        Dog dog2 = new Dog("小黄",22,"黄色");
        dog2.wag();
        dog2.bark();
        dog2.show();
    }
}
